package org.dding.web.console;

import java.util.List;

import org.dding.core.management.DependencyInfo;
import org.dding.core.management.ResourceLoaderInfo;

public class WebModuleInfo {

	public String getClassLoader() {
		return classLoader;
	}

	public void setClassLoader(String classLoader) {
		this.classLoader = classLoader;
	}

	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public String getModuleSlot() {
		return moduleSlot;
	}

	public void setModuleSlot(String moduleSlot) {
		this.moduleSlot = moduleSlot;
	}

	public String getMainClass() {
		return mainClass;
	}

	public void setMainClass(String mainClass) {
		this.mainClass = mainClass;
	}

	public String getModulePath() {
		return modulePath;
	}

	public void setModulePath(String modulePath) {
		this.modulePath = modulePath;
	}

	private List<ResourceLoaderInfo> resourceInfos;
	public String moduleName;
	public String moduleSlot;
	public String modulePath;
	public String classLoader;
	public String mainClass;
	public List<DependencyInfo> dependInfos;
	public boolean unzip;
	public int serviceNum;

	public List<ResourceLoaderInfo> getResourceInfos() {
		return resourceInfos;
	}

	public void setResourceInfos(List<ResourceLoaderInfo> resourceInfos) {
		this.resourceInfos = resourceInfos;
	}

	public int getServiceNum() {
		return serviceNum;
	}

	public void setServiceNum(int serviceNum) {
		this.serviceNum = serviceNum;
	}

	public boolean isUnzip() {
		return unzip;
	}

	public void setUnzip(boolean unzip) {
		this.unzip = unzip;
	}

	public List<DependencyInfo> getDependInfos() {
		return dependInfos;
	}

	public void setDependInfos(List<DependencyInfo> dependInfos) {
		this.dependInfos = dependInfos;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((moduleName == null) ? 0 : moduleName.hashCode());
		result = prime * result
				+ ((moduleSlot == null) ? 0 : moduleSlot.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		WebModuleInfo other = (WebModuleInfo) obj;
		if (moduleName == null) {
			if (other.moduleName != null)
				return false;
		} else if (!moduleName.equals(other.moduleName))
			return false;
		if (moduleSlot == null) {
			if (other.moduleSlot != null)
				return false;
		} else if (!moduleSlot.equals(other.moduleSlot))
			return false;
		return true;
	}

}
